Extended DSK image definition
The extended DSK image is a file designed to describe copy-protected floppy
disk software. It's definition was defined by Marco Vieth, Ulrich Doewich
and Kevin Thacker.
This format has been widely adopted and is one of the major file formats
used (the other major format is the standard disk image with the "MV -
CPC" identifier).
The extended disk image format should be used for copy-protected disc
software, or in place of a standard disk image if the resulting image is
smaller than in the standard disk image form.
Extended DiSK Format (Rev.5)
The disc image has the following format:
| DISK INFORMATION BLOCK (256 bytes) |
| TRACK INFORMATION BLOCK * number of tracks * number of sides |
The track blocks are stored in increasing order 0..number of tracks,
with alternating sides interleaved if the disc image describes a double
sided disk. e.g. if the disk image represents a double sided disk, the
order of tracks is: track 0 side 0, track 0 side 1, track 1 side 0, track
1 side 1.... track (number of tracks-1) side 0, track (number of tracks-1)
side 1
The tracks are always ordered in this way regardless of the disc-format
described by the disc image.
The location of the track information block is found by using the track
size table.
DISK INFORMATION BLOCK
| offset |
description |
bytes |
| 00 - 21 |
"EXTENDED CPC DSK File\r\nDisk-Info\r\n" |
34 |
| 22 - 2f |
name of utility/emulator that created the file |
14 |
| 30 |
number of tracks |
1 |
| 31 |
number of sides |
1 |
| 32 - 33 |
unused |
2 |
| 34 - xx |
track size table |
number of tracks*number of sides |
NOTES:
-
An extended DSK image is identified by the "EXTENDED" tag. The track size
at offset 32h and 33h is ignored for extended format DSK images.
-
Track data starts at offset 100h.
-
The "EXTENDED" tag is present to prevent existing emulators which support
the standard DSK image from interpreting the data wrong and possibly crashing.
-
"\r" is the C programming language equivalent of ASCII character 13.
-
"\n" is the C programming language equivalent of ASCII character 10.
TRACK OFFSET TABLE
| offset |
description |
bytes |
| 01 |
high byte of track 0 length (equivalent to track length/256) |
1 |
| ... |
... |
... |
NOTES:
-
Depending on the information in the disk information block, the table contains
-
track lengths for a single sided floppy disc
-
track lengths for a double sided floppy disc
-
track lengths are stored in the same order as the tracks in the image e.g.
In the case of a double sided disk: Track 0 side 0, Track 0 side 1, Track
1 side 0 etc...
-
A size of "0" indicates an unformatted track. In this case there is no
data, and no track information block for this track in the image file!
-
Actual length of track data = (high byte of track length) * 256
-
Track length includes the size of the TRACK INFORMATION BLOCK (256 bytes)
-
The location of a Track Information Block for a chosen track is found by
summing the sizes of all tracks up to the chosen track plus the size of
the Disc Information Block (&100 bytes). The first track is at offset
&100 in the disc image.
TRACK INFORMATION BLOCK
| offset |
description |
bytes |
| 00 - 0c |
"Track-Info\r\n" |
13 |
| 0d - 0f |
unused |
3 |
| 10 |
track number |
1 |
| 11 |
side number |
1 |
| 12 - 13 |
unused |
2 |
| 14 |
sector size |
1 |
| 15 |
number of sectors |
1 |
| 16 |
GAP#3 length |
1 |
| 17 |
filler byte |
1 |
| 18 - xx |
Sector Information List |
xx |
NOTES:
-
Identical to the original DSK format definition.
SECTOR INFORMATION LIST
| offset |
description |
bytes |
| 00 |
track (equivalent to C parameter in NEC765 commands) |
1 |
| 01 |
side (equivalent to H parameter in NEC765 commands) |
1 |
| 02 |
sector ID (equivalent to R parameter in NEC765 commands) |
1 |
| 03 |
sector size (equivalent to N parameter in NEC765 commands) |
1 |
| 04 |
FDC status register 1 (equivalent to NEC765 ST1 status register) |
1 |
| 05 |
FDC status register 2 (equivalent to NEC765 ST2 status register) |
1 |
| 06 - 07 |
actual data length in bytes |
2 |
NOTES:
-
Identical to the original definition except for the addition of the sector
data length. This value is in bytes and stored in little endian notation.
(low byte followed by high byte)
-
The location of each sectors data is found by adding the size of the previous
sectors, plus the size of the 256 byte header.
-
For 8k Sectors (N="6"), only 1800h bytes is stored.